package Vue;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JLabel;

import Controleur.ConfirmerSuppS_OkListener;
import java.awt.Font;

/**
 * Définit les fenêtres de confirmation de suppression d'une station
 */
public class ConfirmerSuppression extends JDialog {

	
	private static final long serialVersionUID = 1L;
	
	/** panel contenant les éléments graphiques */
	private final JPanel contentPanel = new JPanel();
	
	/**
	 * Instancie la fenêtre de confirmation de suppression d'une station
	 * @param idStation Id de la station à supprimer
	 * @param map Carte à actualiser après la suppression
	 * @param s Fenetre de la station ouverte à fermer après la suppression
	 */
	public ConfirmerSuppression(final int idStation, final Map map,StationFrame s) {
		setModal(true);
		setBounds(100, 100, 334, 200);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		{
			JLabel lblNewLabel = new JLabel("\u00CAtes-vous sur de vouloir supprimer la station ?");
			lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 13));
			lblNewLabel.setBounds(26, 52, 265, 16);
			contentPanel.add(lblNewLabel);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton("OK");
				okButton.setForeground(new Color(0, 128, 0));
				okButton.setActionCommand("OK");
				okButton.addActionListener(new ConfirmerSuppS_OkListener(this,s,map,idStation));
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
		}
	}
	/**
	 * Méthode fermant la fenêtre
	 */
	public void close(){this.dispose();}

}